package summer_vacation.liulee.month7.day20150727;
import java.util.Scanner;
/**
 * Created by Administrator on 2015/7/27.
 */
public class Java27 {
    public static void main(String[] args){
        Scanner p =new Scanner(System.in);
        System.out.println("输入一个数a:");
        double a=p.nextDouble();
       Scanner q=new Scanner(System.in);
        System.out.println("输入一个数b：");
        double b=q.nextDouble();
        Scanner w=new Scanner(System.in);
        System.out.println("输入一个数c：");
        double c=w.nextDouble();
        double disc=b*b-4*a*c;
        if(disc<0){
            System.out.println("该方程无解");
        }
        else
        {
            double m=-b/(2.0*a);
            double n=Math.sqrt(disc)/(2.0*a);
            double x1=m+n;
            double x2=m-n;
            System.out.println("实根x1:"+x1);
            System.out.println("实根x2："+x2);
        }
    }
}
